//
//  FirstViewController.m
//  UI09_homework
//
//  Created by 洛洛大人 on 16/6/16.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "FirstViewController.h"

#import "FirstLabel.h"
#import "FirstTextField.h"
#import "FirstButton.h"

@interface FirstViewController ()

@end

@implementation FirstViewController

- (void)viewDidLoad {
    [super viewDidLoad];
   self.title = @"第一页";
    self.view.backgroundColor = [UIColor redColor];
    [self creatLabel];
    [self creatTextfiled];
    [self creatButton];



}

-(void)creatLabel {
  FirstLabel *label = [[FirstLabel alloc]initWithFrame:CGRectMake(50, 200, 80, 50) withText:@"账号"];
    
    [self.view addSubview:label];
    [label release];
    
    FirstLabel *passwordlabel = [[FirstLabel alloc]initWithFrame:CGRectMake(50, 250, 80, 50) withText:@"密码"];
    
    [self.view addSubview:passwordlabel];
    [passwordlabel release];
    
    
}

-(void)creatTextfiled {
    FirstTextField *textfiled = [[FirstTextField alloc]initWithFrame:CGRectMake(150, 200, 200, 50)];
    textfiled.placeholder = @"请输入账号";
    [self.view addSubview:textfiled];
    [textfiled release];
    
    
    
    FirstTextField *passwordTxetfiled = [[FirstTextField alloc]initWithFrame:CGRectMake(150, 250, 200, 50) ];
    passwordTxetfiled.placeholder = @"请输入密码";
    [self.view addSubview:passwordTxetfiled];
    [passwordTxetfiled release];
    
 }

-(void)creatButton {
    FirstButton *button = [FirstButton buttonWithType:UIButtonTypeSystem];
    button.frame = CGRectMake(50, 350, 300, 100);
    button.backgroundColor = [UIColor cyanColor];
    [button setTitle:@"登录" forState:UIControlStateNormal];
    button.font = [UIFont systemFontOfSize:25];
    button.tintColor = [UIColor grayColor];
    [self.view addSubview:button];
    [button release];
    
    
    FirstButton *button1 = [FirstButton buttonWithType:UIButtonTypeSystem];
    button1.frame = CGRectMake(50, 450, 100, 100);
//    button1.backgroundColor = [UIColor cyanColor];
    [button1 setTitle:@"无法登陆" forState:UIControlStateNormal];
    
    button1.font = [UIFont systemFontOfSize:20];
    button1.tintColor = [UIColor blackColor];
    [self.view addSubview:button1];
    [button1 release];
    
    FirstButton *button2 = [FirstButton buttonWithType:UIButtonTypeSystem];
    button2.frame = CGRectMake(250, 450, 100, 100);
    [button2 setTitle:@"新用户注册" forState:UIControlStateNormal];
    button2.font = [UIFont systemFontOfSize:20];
    button2.tintColor = [UIColor blackColor];
    [self.view addSubview:button2];
    [button2 release];
    
   
    
}





- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
